﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Nau.Airplane.Tests
{
    [TestClass]
    public class SpeechTests
    {
        [TestMethod]
        public void Speech_SimpleTest()
        {
            // Use something like:
            Speech.SpeechHelper.PlayString(string.Format("The time is {0} minutes and {1} seconds", DateTime.Now.Minute, DateTime.Now.Second));

            // Run from test view
        }

        [TestMethod]
        public void Speech_MultiThreadedTest()
        {
            Task t1 = Task.Factory.StartNew(PlaySound);
            Thread.Sleep(100);
            Task t2 = Task.Factory.StartNew(PlaySound);
            t1.Wait();
            t2.Wait();
            //Task t3 = Task.Factory.StartNew(PlaySound);
        }

        private void PlaySound()
        {
            Speech.SpeechHelper.PlayString(string.Format("Runned from thread {0}", Thread.CurrentThread.ManagedThreadId));
        }
    }
}
